const rootPath = process.cwd()
const webpack = require('webpack')
const merge = require('webpack-merge')
const base = require('./base')
const CleanWebpackPlugin = require('clean-webpack-plugin')
var path = require('path')
var no_rebuild = require('./noRebuildModule')
module.exports = merge(base, {
  entry: rootPath + "/src/main.js",
  output: {
    filename: "static/front/js/bundle.[hash].js",
    publicPath: '/',
    path: path.resolve('../')
  },
  watchOptions: {
    poll: 1000,
    aggregateTimeout: 500,
    ignored: /node_modles/
  },
  plugins: [
    new webpack.DefinePlugin({
      "process.env": {
        NODE_ENV: JSON.stringify('production')
      }
    }),
    // new webpack.optimize.CommonsChunkPlugin('common')
    new CleanWebpackPlugin(
      ['static/front/js/*', 'static/front/css/*', 'static/front/images/*'],
      {
          root: path.resolve('../')
      }
    )
  ]
})
